<?php 
include '../data/data.php';
$user=$_SESSION['user']; //获取到的用户名
$pass=$_SESSION['pass']; //获取到的密码
$gid=intval($_GET['game_id']);
$result= mysql_query("SELECT * FROM qudao_games WHERE id='$gid' and userid LIKE '%$dl%'", $link);  
$row = mysql_fetch_array($result);
if($row[type]=='MV'){
      $cbx='满V版';
      }elseif($row[type]=='BT'){
      $cbx='超变版';
      }elseif($row[type]=='GM'){
      $cbx='GM版';
      }elseif($row[type]=='H5'){
      $cbx='H5版';
}
if($row[id]!=''){
}else{
	header('location:/index.html');
}
mysql_query("UPDATE qudao_games SET renqi=renqi+'1' WHERE id='$gid'", $link);
?>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="keywords" content="<?php echo $row[name].$cbx; ?> GM后台版 角色扮演 H5 HTML5 H5游戏 HTML5游戏 小游戏 手机游戏 网页游戏 在线游戏 点击即玩 <?php echo $rowx[name]; ?> <?php echo $rowx[name]; ?>">
<meta name="description" content="10元无限,GM后台道具随便刷">
<title><?php echo $row[name].$cbx; ?> - 热门H5游戏平台</title>
<link rel="stylesheet" href="/public/styles/base.css"/>
<link rel="stylesheet" href="/styles/game_info.css"/>
    <link rel="stylesheet" href="/css/new.css"/>
    <link rel="stylesheet" href="/styles/ranking.css"/>
    <link rel="stylesheet" href="/layer/mobile/need/layer.css"/>
</head>
<style>
     .btn_green2 {
        height: 25px;
        line-height: 25px;
        border: none;
        padding: 0 14px;
        position: absolute;
        top: 50%;
        margin-top: -12px;
        right: 0;
    }
     .gift_list li .fr {
         width: 54px;
         height: 24px;
         background: #FF7200;
         border-radius: 4px;
         margin: 30px 16px 0 0;
         position: relative;
     }
</style>
<div class="gnod">
    <div class="gokb">
                    <a target="_top" href="/user/user.html">
                <img src="/images/user_center/default_im.png"
                     alt=""/>
            </a>
            </div>
    <div class="search newser">
        <input type="text" id="search_ipt" placeholder="请输入搜索内容" autocomplete="on" class="left_input"/>
        <input type="submit" id="search_btn" class="search_icon" value=""/>
    </div>
</div>
<body class="bg00">
<!--div.container 总外框  start-->
<div class="z_container bg01">

    <!--div.z_min 内容区域 statr-->
    <div class="z_main" data-role="conent">
        <!--div.infos 游戏信息 statr-->
        <section class="infos game_list block_bg">
            <div class="infos_main">
                <div class="game_log relative">
                    <a><img src="<?php echo $row[logo]; ?>" alt="<?php echo $row[name].$cbx; ?>" width="100%" height="auto"/></a>
                </div>
                <div class="game_info" id="ne_info">
                    <h3>
                        <span><?php echo $row[name].$cbx; ?></span>
                    </h3>
                    <span class="start_list fl" style="margin-top: 10px;">
                        <i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i>                    </span>
                                        <p><span style="color: #FF0000"><?php echo $row[renqi]; ?>万+</span><span style="margin-left: 10px;">版本：<?php if($row[ty]=='1'){echo '手游';}elseif($row[ty]=='0'){echo 'H5';} ?></span><span>人气：</span> </p>
                                    </div>
                <div class="buto">
                    <div class="game_btn" style="margin-top: 15px;"><?php 
                      if($row[type]=='GM'){
                      ?>
                      <a target="_top" style="background: #FF7200;top: 200%;left: 0;"  href="/game/gback.html?game_id=<?php echo $row[id]; ?>" class="btn_blue">后台</a>
                      <?php
                      }
                      ?><?php
                      if($row[ty]=='0'){
                      echo '<a target="_top"  onclick="countDownload(this,100)"  href="'.$row[Android].'" class="btn_blue">开始玩</a>';
                      }elseif($row[ty]=='1'){
                       if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  if($row[ios]!=''){
    echo '<a target="_top"  onclick="countDownload(this,100)"  href="'.$row[ios].'" class="btn_blue">苹果下载</a>';
  }else{
  	echo '<a target="_top" onclick="countDownload(this,100)" href="#" class="btn_blue">暂无下载</a>';
  }
}else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
    if($row[Android]!=''){
	echo '<a target="_top"  onclick="countDownload(this,100)"  href="'.$row[Android].'" class="btn_blue">安卓下载</a>';
  }else{
  	echo '<a target="_top"  onclick="countDownload(this,100)"  href="#" class="btn_blue">暂无下载</a>';
  }
}else{
    if($row_Recordset1[anzhuo]!=''){
	echo '<a target="_top"  onclick="countDownload(this,100)"  href="'.$row[Android].'" class="btn_blue">点击下载</a>';
  }else{
  	echo '<a target="_top"  onclick="countDownload(this,100)"  href="'.$row[Android].'" class="btn_blue">安卓下载</a>';
  }
}
                      }
                      ?>
                      
                                                </div>
                </div>
            </div>
        </section>
        <div style="width: 100%;height: 1px;background: #f4f4f4;"></div>
        <!--div.infos 游戏信息 end-->
        <div class="choie" style="position: relative;">
                <div style="margin-left: 3%" class="gisows gisow"> 详情</div>
                <div class="gisows">开服(1) </div>
                <div class="gisows">资讯(<?php 
$sql = "select count(*) from info where gameid LIKE '$gid'";
$row0 = mysql_fetch_array( mysql_query($sql) );
  if(isset($row0[0])){
    echo $row0[0];
}else{
echo '0';
}
?>) </div>
            <div style="width: 100%;height: 1px;background: #f4f4f4;position: absolute;bottom: 11px;left: -11%;"></div>
        </div>

        <!--div.to_play 游戏功能 end-->

        <!--div.game_banner 图片banner区域 start-->
        <div class="geion">

            <div style="display: block">
                <div class="game_banner block_bg">
                    <div class="list_imgs swipe" id='slider'>
                        <ul id="img_slider" class="swipe-wrap">
                          <li class="wrap">
                          <?php 
                          if($row[tua]!=''){
                          ?>
                       <a><img src="<?php echo $row[tua]; ?>" alt="<?php echo $row[name].$cbx; ?> 游戏截图" width="100%" height="auto"></a>
                          <?php
                          }
                          if($row[tub]!=''){
                          ?>
                       <a><img src="<?php echo $row[tub]; ?>" alt="<?php echo $row[name].$cbx; ?> 游戏截图" width="100%" height="auto"></a>
                         <?php
                          }
                          ?></li>
                          <li class="wrap">
                          <?php 
                          if($row[tuc]!=''){
                          ?>
                       <a><img src="<?php echo $row[tuc]; ?>" alt="<?php echo $row[name].$cbx; ?> 游戏截图" width="100%" height="auto"></a>
                          <?php
                          }
                          if($row[tua]!=''){
                          ?>
                       <a><img src="<?php echo $row[tua]; ?>" alt="<?php echo $row[name].$cbx; ?> 游戏截图" width="100%" height="auto"></a>
                         <?php
                          }
                          ?></li>
 </ul>
                    </div>
                    <div class="btn_check">
                        <ul></ul>
                    </div>
                </div>
                <div style="width: 100%;height: 1px;background: #f4f4f4;"></div>
                <div style="margin-bottom: 100px;">
                    <p style="font-weight: bold;font-size:15px;color: #333333;margin: 15px 0 0 15px;">游戏介绍</p>
                    <p >
                        <div style="font-weight: 500;font-size:13px;color: #666666;margin: 15px 0 0 15px;">
                        <?php echo $row[jieshao]; ?>
                  </div></p>
                </div>
            </div>
                        <div style="display: none;">
                    <ul id="game_list_0" class="wrap">
                                                    <li style="width: 100%;height: 24px;margin-top: 20px;">
                                <div class="open_one totil">
                                    <div style="margin-left: 16px;">
                                        <span style="margin-right: 50px"><?php echo $row[date]; ?></span>
                                        <span>10:00:00</span>
                                    </div>
                                    <div class="serves"> 新区</div>
                                </div>
                            </li>
                                            </ul>
                </div>
                    <div style="display: none;">
                     <ul id="game_list_0" class="wrap">
                     <?php  

$resultx = $conn->query("SELECT id, date, name FROM info WHERE userid='$dl' and gameid='$gid' ORDER BY id DESC limit 4");
if ($resultx->num_rows > 0) {
    while($rowx = $resultx->fetch_assoc()) {
        echo '<li style="width: 100%;height: 24px;margin-top: 20px;">
                            <a href="/info/detail.html?info_id='.$rowx[id].'">
                            <div class="open_one" style="width: 100%;height: 24px;margin-right: 50px;font-size: 13px;color: #999999;font-weight: 500;">
                                <div style="margin-left: 16px;width: 60%">
                                    <p style="color: #333333;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;text-align: left;">'.$rowx[name].'</p>
                                </div>
                                <div style="float: right;color: #999999;margin-right: 16px;"> '.$rowx[date].'</div>
                            </div>
                            </a>
                        </li>';
    }
}
?>
                      </ul>
                </div>
                    </div>
        <!--div.game_banner 图片banner区域 end-->

        <!--div.game_detail 游戏介绍 start-->
        <!--div.game_detail 游戏介绍 end-->
    </div>
    <!--div.z_min 内容区域 end-->
</div>
<!--div.container 总外框  end-->
<!--footer 底部 start-->
<footer id="footer" class="z_footer" style="">
    <nav>
        <a target="_top" href="/index.html" style="margin-left: 2%;">
            <p class="img_1"><img src="/picture/home.png" alt=""></p>
            <p class="img_2"><img src="/picture/home1.png" alt=""></p>
            <span>首页</span>
        </a>
        <a target="_top" href="/game/type.html?tc=GM" >
            <p class="img_1"><img src="/picture/game.png" alt=""></p>
            <p class="img_2"><img src="/picture/game1.png" alt=""></p>
            <span>GM</span>
        </a>
        <a target="_top" href="/game/game.html?tc=rm" title=""  id="footer_nav_active">
            <p class="img_1"><img src="/picture/game.png" alt=""></p>
            <p class="img_2"><img src="/picture/game1.png" alt=""></p>
            <span>BT</span>
        </a>
        <a target="_top" href="/user/user.html" title="">
            <p class="img_1"><img src="/picture/user.png" alt=""></p>
            <p class="img_2"><img src="/picture/user1.png" alt=""></p>
            <span>我的</span>
        </a>
    </nav>
</footer>
<link href="/css/app.css" rel="stylesheet" type="text/css">
<div id="weixin_an" style="display: none">
    <div class="click_opacity"></div>
    <div class="to_btn">
        <span class="span1"><img src="/public/channel/click_btn.png"></span>
        <span class="span2"><em>1</em> 点击右上角<img src="/public/channel/menu_android.png">打开菜单</span>
        <span class="span2 android_open"><em>2</em> 选择<img src="/public/channel/android.png"></span>
        <span class="span2 android_open"><em>3</em> 重新登录账号充值</span>
    </div>
</div>
<!--二维码-->
<script src="/public/scripts/jquery-1.11.1.min.js"></script>
<script src="/public/scripts/jquery.qrcode.min.js"></script>

<!--<div class="qrcode_image">-->
<!--        <img src="/qrcode/game.html?addr=--><!--">-->
<!--</div>-->
<script>
    /**
     * 统计
     */
    // var is_weixin = (function(){return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1})();
    // window.onload = function() {
    //     if (is_weixin) {
    //         $('#weixin_an').show();
    //     }
    // }
</script>

<div style="width: 100%;height: 50px;"></div>
<script src="/public/scripts/jquery-1.11.1.min.js"></script>
<script src="/public/scripts/jquery.mobile.min.js"></script>
<script src="/layer/layer.js" type="text/javascript"></script>
<script src="/jquery/swipe.js"></script>
<script>
        $('#footer a:eq(2)').attr('id', 'footer_nav_active');
    $(function(){
	$(".z_container").css({"padding-top":0});

	var img_nums = $('#img_slider li').length;
	if( img_nums > 0 ) {
    	var html = (new Array(img_nums + 1)).join('<li></li>');
    	html = $(html);
    	html.eq(0).addClass('active_role');
    	$('.btn_check ul').append(html);
	}
    window.mySwipe = Swipe(document.getElementById('slider'), {
        auto: 2000,
        continuous: true,
        disableScroll: false,
        stopPropagation: false,
        callback: function(index, element) {
            $(".btn_check ul li").eq(index % img_nums).addClass("active_role").siblings().removeClass("active_role");
        }
    });

    //收藏
    var favorited = false;
    var loading = false;
    $('#add_favorite').tap(function(){
        if( '76805' == '' ) {
            if( confirm('还未登录，是否现在去登录？') ) {
                location.href = '/user/login.html?fwd=%2Fgame%2Fdetail.html%3Fgame_id%3D366';
            }
        } else if( ! favorited ) {
            if( loading ) return false;
            loading = true;
            $.post('/user/addfavorite.html?game_id=366', '', function(msg){
                if( msg == 'success' ) {
                    $('#add_favorite img').attr('src', '/images/game_info/info_12.png');
                	favorited = true;
                } else if( msg ) {
                    alert(msg);
                }
                loading = false;
            });
        }
    });
});
</script>
<script>
    $(function(){
        $('.gisows').click(function(){
            var i = $(this).index()
            $(this).siblings().removeClass('gisow');
            $(this).addClass('gisow');
            $('.geion').children().css('display','none');
            $('.geion').children().eq(i).css('display','block');
        });
    });
</script>
<script>
    $('.game_logo').click(function(){
        $(this).addClass('new_imgs');
        var giftid = $('.new_imgs').attr("id");
        giftid = giftid.substring(5);
        var cla = '#changepwdwin_'+giftid;
        var nui = '#gift_'+giftid;
        $(this).removeClass('new_imgs');
        var index = layer.open({
            title: false,
            type: 1,
            skin: 'layui-layer-demo', //样式类名
            closeBtn: 0, //不显示关闭按钮
            anim: 2,
            shadeClose: true, //开启遮罩关闭
            area: ['343px', '290px'], //宽高
            content: $(cla),
        });
    });
    $(function(){
        //领取
        $('.geton').on('tap', function(){
            var cdkey = ' ';
            $(this).addClass('new_get');
            var giftid = $('.new_get').attr("id");
            giftid = giftid.substring(9);
            // $(this).text('复制');
            $(this).removeClass('new_get');
            $.post('/activity/sendout.html', 'gift_id='+giftid+'', function(msg){
                loading = false;
                cdkey = msg.cdkey;
                $('#gift_cdkey').val(msg.cdkey);
                // if( msg.cdkey != '' ) {
                //     $('#gift_get').addClass('btn_gray');
                // }
                if(msg.msg=='还未登录！'){
                    layer.confirm('还未登录，是否跳转登陆', {
                        title: false,
                        btn: ['是','否'] //按钮
                    }, function(){
                        location.href = '/user/login.html?fwd=%2Factivity%2Fgiftbag.html';
                    }, function(){
                    });
                }else{
                    layer.alert('', {
                        title:'礼包码已领取',
                        area: ['323px', '163px'], //宽高
                        content: '请点击复制按钮！',
                        end: function () {
                            location.reload();
                        }
                    });
                }
            }, 'json');
        });
        // $('.getons').click(function(){
        //     var cds = $(this).parents('.fr').find('.texts').val();
        //     layer.alert('', {
        //         title:'礼包码已复制',
        //         area: ['323px', '163px'], //宽高
        //         content: cds,
        //     });
        //     var Url2 = $(this).parents('.fr').find('.texts');
        //     Url2.select(); // 选择对象
        //     document.execCommand("Copy"); // 执行浏览器复制命令
        // });
    });
    function copyUrl(e){
        var Url2 = document.getElementById('mytext_'+e);
        var text=Url2.value;
        var valueLength = text.length;
        selectText(Url2, 0, valueLength);
        if(document.execCommand('copy', false, null)){
            document.execCommand('copy', false, null)// 执行浏览器复制命令
            layer.alert('', {
                title:'礼包码已复制',
                area: ['323px', '163px'], //宽高
                content: text,
            });
        }else{
            console.log("不兼容");
        }
    }
    function selectText(textbox, startIndex, stopIndex) {
        if(textbox.createTextRange) {//ie
            var range = textbox.createTextRange();
            range.collapse(true);
            range.moveStart('character', startIndex);//起始光标
            range.moveEnd('character', stopIndex - startIndex);//结束光标
            range.select();//不兼容苹果
        }else{
            //兼容苹果
            textbox.setSelectionRange(startIndex, stopIndex);
            textbox.focus();
        }
    }
</script>
    <script>
        $('#search_btn').on('tap', function(){
            var v = $.trim($('#search_ipt').val());
            v = v.replace(/[\'\"\?`~\!\$\%\^\*\(\)\[\]\{\}\-\+\\]+/, '');
            $('#search_ipt').val(v);
            if( v == '' ) {
                alert('请输入游戏名称、拼音或关键字！');
                $('#search_ipt').focus();
                return false;
            }
            location.href = '/search.html?search='+ encodeURIComponent(v);
        });
        $('#search_ipt').bind('keydown',function(event){
            if(event.keyCode == "13") {
                var v = $.trim($('#search_ipt').val());
                v = v.replace(/[\'\"\?`~\!\$\%\^\*\(\)\[\]\{\}\-\+\\]+/, '');
                $('#search_ipt').val(v);
                if( v == '' ) {
                    alert('请输入游戏名称、拼音或关键字！');
                    $('#search_ipt').focus();
                    return false;
                }
                location.href = '/search.html?search='+ encodeURIComponent(v);
            }
        });
        $("#search_ipt").mousedown(function(){
            $('.history').css("display","block");;
        });
    </script>
</body>
</html>